package api;
/**定义一个盒子类型,并应用自定义的泛型*/
class Box<T>{
    private T content;
    public void setContent(T content) {
        this.content = content;
    }
    public T getContent() {
        return content;
    }
}
public class GenericDemo02 {
    public static void main(String[] args) {
        Box<String> x1=new Box<>();
        x1.setContent("hello generic");
        String content = x1.getContent();
        System.out.println(content);
        Box<Long> x2=new Box<>();
        x2.setContent(10L);
        Long content1 = x2.getContent();
        System.out.println(content1);
    }
}
